﻿package  
{
	import com.ixiyou.events.QueueLoadEvent;
	import com.ixiyou.net.QueueLoad;
	import flash.display.Loader;
	import flash.display.Shape;
	import flash.display.SimpleButton;
	import flash.display.Sprite;
	import flash.net.URLLoaderDataFormat;
	
	/**
	 * ...
	 * @author magic
	 */
	public class TestQueueLoader extends Sprite
	{
		private var ql:QueueLoad;
		public function TestQueueLoader() 
		{
			ql = new QueueLoad();
			ql.addEventListener(QueueLoadEvent.COMPLETE, complete);
			//ql.insert("test.jpg", -1, { id:"magic", type:URLLoaderDataFormat.BINARY } );
			ql.add("test.jpg", -1, { id:"magic", type:URLLoaderDataFormat.BINARY } );
			ql.start();
			//ql.clear();
		}
		private function complete(e:QueueLoadEvent):void {
			var loader:Loader = new Loader();
			addChild(loader);
			loader.loadBytes(ql.getData("magic"));
		}
	}
	
}